Repository navigation
feat(muster): set tool approval on connectors and show every URL elicitation as one prompt - #3655
Conversation
…elicitation kagent relays an MCP URL elicitation's elicitationId as elicitation_id. muster returns the browser from its pages with it, so the session page needs it to know which request the person finished.
…prompt Sign-in, muster's approval page and any later page look the same: the server's message as the heading, Open with the link's host, Done and Not now. A link on the origin of the session's muster opens with a redirect back to the session carrying the elicitationId, and the tab that opened it lets the agent continue on muster's return. The return says nothing of the decision: the outcome is muster's answer to the retried call. Replaces SignInRequestPanel and the sign-in-path keyed return of elicited links in ConnectorSignInLinks (giantswarm/giantswarm#38902, slice 6).
muster with tool approval takes the connection (type, URL, sign-in, client, headers, request metadata) only through core_mcpserver_connect and refuses it on core_mcpserver_update. The wizard's edit and the JSON edit now split by connect's input schema, connect first; a muster without connect still gets one update. The fixture declares and refuses the split arguments as muster does, and muster-backend answers those refusals 422.
…nce mode Nothing reports the governance mode to the portal yet, and the portal read its absence as trusted: a create sent the allow-all preset, also on a governed installation. An unknown or unreadable mode now picks Recommended and the Test & Tools step says the mode could not be read. governanceModeOf is the one place the mode's source plugs in, and the server-info query key is shared.
…its preset muster stores a create's preset as its rule alone, since no tools are listed yet, and reports every tool New. The wizard took that for reviewed: every tool New, the draft the bare rule, and Done saved nothing. Settings without a tool's own entry now open on the preset expanded against the listed tools, without New markers, and Done writes each tool. The Tools tab says the connector is not reviewed and what its tools do until then. The fixture stores a create's preset as muster does and refuses a create without approval settings.
…nwhile core_mcpserver_set_approval replaces spec.approval whole and takes no precondition, so a save from a step opened before another admin's change reverted it silently. The save now re-reads the settings right before writing and, when they changed since the draft was built, writes nothing and shows the current settings with the person's changes on top. Where the portal cannot save, the step says Done saves nothing.
… tab made The session page answered Done for any visit that named a pending elicitationId, which travels in the session's messages, and added a return to every link on muster's origin. Each Open now carries a new random value in the redirect, kept per tab with the elicitation, task, session page and person, and used up by the one return that brings it back. Only muster's approval page and sign-in start get a return; the approval page's return names the elicitation muster recorded.
…pages muster serves its approval page and sign-in start on its publicUrl, which the chart sets apart from the endpoint muster-backend reaches it by. muster.installations[].publicUrl names it, /installations reports it, and the session page trusts URL elicitation links by it, else by the endpoint's origin as before.
A connector's rule for tools without their own entry takes Block beside Allow and Ask: tools added later are hidden and refused until someone sets them. The Test & Tools step offers it where muster's set_approval declares it, keeps Ask pre-selected on a governed platform, and the Tools tab says when the rule hides tools added later. The fixture takes and enforces it as muster will.
…ansient failure Every create now reads the create tool's schema for the preset, where one without a display name or tags read none before, so a transient describe failure stopped adding a connector. That read is retried once.
…pills properly The unreadable-settings note says muster reports every tool as Ask and does not run them, and that Done saves nothing there. Pills are described by their legend line through aria-describedby instead of aria-description. A blocked row counts under no effect in the Tools tab's facet. The unwired Allowed for prop is removed until agent-manager's grants exist (slices 3 and 5).
…ter takes it muster's core_mcpserver_set_approval now takes expectedGeneration and refuses a write when the MCPServer changed since. The save sends the generation of its read right before writing, so a change in between is refused too and shown as the same conflict. The fixture declares and enforces the precondition, and muster-backend answers it 422.
Settings with a rule and no tool entries opened on Recommended, so a stored Block rule became Ask and Done loosened it. The draft now keeps Block and fills the listed tools with Ask all.
…r_list muster reports governance beside the servers on core_mcpserver_list, which muster-backend's /servers passes on; /server-info never carries it, so the mode was always unknown. The wizard and the create now read it from the server list, then /server-info, and stay on Recommended when neither names one. Tests and the fixture use that response shape.
Done on settings with a Block rule and no tool entries wrote every listed tool as Ask, loosening what the rule hid. Those tools now keep their effective setting, Block, unless the person changes them.
Input is one labelled block in the details, fingerprint labelled, Acts for shows the person's name with subject as tooltip.
Every key of the approval Input stays visible; each long string value, or very large nested array or object, collapses on its own. The details use one text style, no code font.
Review record — Quentin's reviewPart of giantswarm/giantswarm#38902. Answers the review of 2026-11-27 (comments below). Branch
Approval card changes since the last record
Independent re-checkClaude Fable, 2026-11-28, detached worktree at
Open items
|
|
@QuentinBisson thanks for the thorough review (your comment). Addressed: QB-04 fixed in Details and the independent re-check are in the review record. |
…e Show details The Input block moved into the details and Acts for shows the person's name with the subject as tooltip; the panel tests still looked for them on the card.
The split agent writes, set_agent_approval and list_approval_grants address an organization's agents by its name like main's other agent tools, in the client and in fixture mode. Dropping giantswarm-simple-oidc from the federating connectors moves to gs-node's oidcIdentity, which the sign-in resolver uses on this branch.
Review record — merge roundPart of giantswarm/giantswarm#38902. Reviewer: Claude Fable 5.2, independent of the implementing and merging model, read-only, verdicts formed from the code. Full review: Covers
|
… person is not signed in
… and Fingerprint as detail rows
…guage details, no Not now beside Decline
…dow the warning's
|
Fixture mode can't show the session side of this PR: none of the fixture sessions waits on a URL elicitation, so the new prompt ( |
Review record — last check (UI)Independent code and security review by Claude Fable 5.2 of Result: 0 blocker, 0 high, 3 medium (1 security), 3 low (1 security), 2 info. No way found to approve something other than what is shown. Holds: every field the decision's digest covers is on the card or exempt for a true reason ( Medium:
Low and info (name brackets as the only boundary, unpinned mappings and fallbacks, three accessibility gaps, stale comments) are in the full review. Resolution (
|
|
@marians thanks, good catch. Added in
One limit: Open goes to the fixture muster's host, which does not exist, so the return from the sign-in page and auto-continue cannot run in fixture mode. Done answers the elicitation the way the return does. If you want the return covered too, I can add a fixture route that stands in for muster's page. Also note that the fixture approval names a fixed agent ( |
backstage.musterWorkloadToken.enabled (off by default) mounts a projected ServiceAccount token with audience muster, renewed by the kubelet, at /var/run/secrets/muster.giantswarm.io/serviceaccount/token and sets muster.workloadTokenFile on it. A portal deployed on its own, outside the Agent Platform chart, can then decide tool approvals inline once muster binds its ServiceAccount to muster-approval-decider.
JS Dependency Audit0 added · 0 removed · 76 total (0 vs base) Projects audited
No change in vulnerabilities compared to the base branch. Full current vulnerability list (76)
|
…jection backstage.musterWorkloadToken.expirationSeconds is at most a day, and the render fails when backstage.extraVolumes or extraVolumeMounts already name muster-workload-token, as a chart that deploys the portal and projects the token itself does, instead of a pod the API server refuses.
JS Dependency Audit0 added · 0 removed · 76 total (0 vs base) Projects audited
No change in vulnerabilities compared to the base branch. Full current vulnerability list (76)
|
Review record — portal workload tokenIndependent code and security review by Claude Fable 5.2 of Result after the fixes: 0 blocker, 0 high, 0 medium, 0 low, 1 info. First round: 2 low (1 security). Holds: off by default and nothing renders; audience
|
Part of giantswarm/giantswarm#38902. The review record is the first comment on this PR, with an update comment for the later work and a record of the review round of 2026-11-27 (Quentin).
Rationale
muster now decides Allow, Ask or Block for every tool call (giantswarm/muster, linked below). The portal is where a connector admin sets those settings, where a person sees them, and where a session shows the approval page an agent's call needs. A session also had a separate prompt for each kind of URL elicitation; muster's approval link needs the same prompt as its sign-in link.
Changes
Allow · Ask · Blockpills per tool and the rule for new tools (Allow, Ask, Block). Done saves every tool's setting explicitly throughcore_mcpserver_set_approval. Everyone else sees the settings read-only.presetwhere muster'score_mcpserver_createtakes one. Edits go through muster's split writes: connection fields throughcore_mcpserver_connect, the rest throughcore_mcpserver_update. A save re-reads the settings first, writes nothing over another admin's change and sendsexpectedGenerationwhere muster takes it.core_mcpserver_list, then/server-info. An unknown or unreadable mode pre-selects Recommended and says so, never Allow all.UrlElicitationPanelreplacesSignInRequestPanel: every URL elicitation of a session shows the server's message as heading, Open names the host, Done and Not now answer. A link on muster's approval page or sign-in start gets a return bound to the open this tab made (a random value, used once); the tab that opened it lets the agent continue.muster.installations[].publicUrlnames where an installation's muster serves its pages when that is not on the host ofurl;/api/muster/installationsreports it. New portal eventMuster.toolApprovalSaved.Allow · Ask · Block) and a default, with who may skip an Ask (Allowed for). Create sendscreate_agentthenset_agent_approval; edit goes through agent-manager's split writes (update_agent,update_agent_access,set_agent_approval), live and in commit mode. Saves are guarded against stale reads (generation) and against an agent-manager without the split tools; a save that clears exceptions says so. Charts without settings are explained, and a release not yet enforcing shows pending enforcement.core_mcpserver_list/filter_toolsreports for an agent's tool list are shown (who may skip an Ask, namespaces whose grants could not be read are counted, an unreadable grant is never read as none).docs/fixtures.md);docs/agent-platform.mddescribes an agent's tool approval in the portal. Four changesets.InlineApprovalcard replaces the approval tab in the chat: Approve and Decline with every field muster's digest covers (a long value is collapsed, never cut; Approve is armed only after the card was in view for 1 s; long values stay collapsed behind Show all with the number of hidden characters, and the decision covers the whole request), the agent named by its display name withnamespace/namebeside it, a warning unless muster names the Session's own agent. muster-backendPOST /api/muster/approvals/viewand/approvals/decisionforward the signed-in person's own token (refused with 403 when it is not theirs) and the portal's workload token (muster.workloadTokenFile, sent only to the home installation,muster.workloadInstallation). Open in muster stays.POST /api/muster/handoffgets a one-time ticket for the person's own connector sign-in; links on muster's own origin open after the chat's Open click without a second dialog, other origins keep the dialog, which now names the link's full host. After the return the tab tells the chat tab (BroadcastChannel, scoped to the return's nonce) and the chat submits Done itself; Done stays as fallback.grantScope: subjectfor a discovered authorization server on new connectors, so one sign-in serves every conversation of the person; existing connectors are not widened.lucide-react1.72.0 in the muster and agent-platform plugins); the sign-in resolver's identity mapping moved to gs-node (oidcIdentity) so the own-token check shares it.Effect on end users
Connector admins set whether each tool of a connector runs, asks first or is blocked, and a session shows the approval step an agent's call needs as one clear prompt.
UI impact
Draft footprint for the
ui-impactskill (run it at the final head; this is not the block it writes):ui-sitemapskill.new-flowPreview
Screenshots of the wizard step, the Tools tab and the session prompt follow with the visual check, still to be done by hand.
Changes from the plan
Where this PR differs from the design in the epic (giantswarm/giantswarm#38902):
rule: Blockis offered in the wizard and on the Tools tab where muster's schema allows it, and a stored Block rule is always shown.core_mcpserver_set_approval, which never gets apreset. Create sends the mode'spresetonly where muster's schema declares it.expectedGeneration, so a save can't overwrite a concurrent admin's change.connectorAdminis read per tool; the governance mode comes fromcore_mcpserver_list, then/server-info; Allowed for comes from agent-manager'slist_approval_grants, notlist_agents; an agent's list is read astoolSettingsanddefaultApproval(toolskeeps its old meaning).requireApproval.aria-describedbyper pill replace hover tooltips./approvals/<id>and the sign-in start under the trusted public URL return, and that URL can be set per installation withmuster.installations[].publicUrl. An id alone could resume any waiting prompt.namespace/namebeside it.grantScope: subject.Background and context
core_mcpserver_update, the settings read as unavailable, and the governance mode falls back to Recommended.Upgrade notes
muster.installations[].publicUrl, set it when an installation's muster serves its pages (oauth.mcpClient.publicUrl) on another host than itsurl; else the session page returns by the endpoint's origin as before.muster.workloadTokenFile(the projected ServiceAccount token with audiencemuster) and, when the installation cannot be derived,muster.workloadInstallation; and a muster that trusts the portal's client. Without them the card offers muster's page.Related pull requests (milestones 1 to 3)
Ask to reviewers
9d62912f..3800faa4) was reviewed independently (slice 5 review); its fixes and the commits up to6e5760c7were read in a delta review, the follow-ups up to8924f5cfin a last review (no blocker, major or medium). Not independently re-checked:ca986802(the fix after the second re-check) and33dda99f(the fixes of the delta review). The last review's findings (L-04, L-06, L-07, L-09, L-12) are open and listed in the record. After that, a security review of the inline path and a last check (second model; update comment in the review record) covereddd0dfa53,121a1f57,f0d55590,14680a98, the display name and the icons; not independently re-checked:886f8b6b(own-token check, workload token to the home installation),b3785d0d(docs) and5ffe495c(made after the last check: Approve no longer waits until every collapsed value was opened). Open from that check: LC-06, LC-09, LC-11, LC-15, LC-16 (LC-10 is moot).e3eee50e; the card layout (8acfc2de,9a5ef4eb) was re-checked and its finding N-1 fixed in790af584, with the laterd33145f6and790af584not independently re-checked; see "Review record — Quentin's review". Tip834570ca(834570caonly moves two panel tests to the details).Testing
yarn tscyarn test plugins/muster/ plugins/muster-backend plugins/gs-node/src/muster plugins/agent-platform/src/{lib,hooks,components/UrlElicitationPanel}(Node 24.22.3)79d3c8f3no-mixed-plugin-importinuseMusterOrigin.ts, by design)23a5bb77,d25fc808,ca986802; the tip then wasca986802)core_mcpserver_list, with tests and a fixture that reportsgovernance; not part of the 4811 abovecore_mcpserver_set_approvalas admin 200 and as viewer 422, an Ask tool answered with the elicitation5ffe495c6e5760c7)jest --maxWorkers=4on a Node 24 shim: muster plugin 19 suites, 439 tests; agent-platform plugin 15 suites, 285 tests; ui-reactMoreActionsMenu1 suite, 3 tests; all pass8924f5cf)useCreateSession34 tests; pass.tscand lint not re-run by the reviewersgovernance, refusal reasons,expectedGeneration)Agentlab re-test, 2026-11-25 (
lab-tests/m1-retest.md): passed, no blocking defects. Check J (HTTP level):core_mcpserver_set_approvalas admin 200 and as viewer 422, an Ask answered with the elicitation,core_mcpserver_listpassesgovernance; the portal rand25fc808, one commit before the tip. The visual check in a real browser (wizard step, Tools tab, session prompt after the return, the agent tool settings) is still pending.Milestone 2 lab (2026-11-26,
lab-tests/m2-integration.md, portal backend at HTTP level oncc66a6f4):/api/muster/callget_agentreturnstoolSettings,defaultApproval,grants,approvalSettings,approvalEnforcedandgeneration;list_agentscarries them;create_agentwith Ask and Block entries anddefault: Block200;set_agent_approvalas admin 200 with the grant; a stale write 409 with the conflict text; passed. Not tested in a browser. The milestone 3 lab ran no portal cases.Later work (2026-11-26): the portal backend ran in lab at
dd0dfa53(ticket for the person's own approval, none for another person's),f0d55590(view, decision, foreign person, changed digest, one agent turn continued) and14680a98(decision with its workload token); no browser click. Last check (second model,14680a98, jest on a Node 24 shim): muster-backend 4 suites, 217 tests; agent-platform inline approval and elicitation 4 suites, 84 tests; muster 5 suites, 370 tests; ui-react consent 3 suites, 27 tests; all pass; 21 mutants, 15 killed.886f8b6bhas tests per route (another person's token refused before muster is called); a mutant that skips the check fails 8. Not run by anyone:tsc, lint and the full jest run on the tip, a browser.Default agent session start (2026-11-26, found by a manual test): the key rotation after an answered refusal is covered by unit tests (
useCreateSession); the dev portal picks up the change on a reload, while the lab's in-cluster portal still ran an older image and reuses the key. Not seen in a browser.Review round 2026-11-28 (
e3eee50e..790af584): RTL tests for all-Blocked entries and rule-only Block, later keys visible, per-value collapse and nested structure; at9a5ef4ebthe independent re-check ranNewConnectorTestPage(44) andInlineApprovalplusUrlElicitationPanel(64), all green; 200k random inputs reconstruct to muster's canonical text. No browser check of the new layout.